import { Random } from "mockjs";
import type { MockMethod } from 'vite-plugin-mock';

/**
 * issues
 * - 使用Random.dataImage会报错
 * - 必须使用type导入MockMethod
 */

export default [
  // 验证码
  {
    url: '/assist/captcha',
    method: 'post',
    response: {
      code: 200,
      data: {
        captchaImg: Random.image('200X100', '#4A7BF7', '3366'),
        token: 'admin-token'
      },
      msg: '验证码'
    }
  },
  {
    url: '/assist/login',
    method: 'post',
    response: {
      code: 200,
      data: {
        token: 'admin-token',
        tznUser: {
          areaId: null,
          createTime: "",
          id: "",
          name: "",
          number: "",
          password: "",
          status: "1",
          type: "",
        }
      },
      msg: '登录成功'
    }
  }
] as MockMethod[]